#ifndef LOOP_SUBDIVIDER_H

//--------------------------------------------------------
//		DEFINITIONS
//--------------------------------------------------------
#define LOOP_SUBDIVIDER_H

//--------------------------------------------------------
//		INCLUDES
//--------------------------------------------------------
#include "Subdivider.h"

//--------------------------------------------------------
//		CLASS: LoopSubdivider
//--------------------------------------------------------
class LoopSubdivider : public Subdivider
{
public: // Public Interface

	LoopSubdivider(){}
	~LoopSubdivider(){}

	void subdivide			( ModelFrame* frame );	// completes one iteration of subdivision 
	void showConnectivity	( const Selection* s );	// sets the "important mesh" for a given point or face
	void showWeights		( const Selection* s ); // sets the weights from coarse mesh points for a given connectivity point 
	Point doSubdivisionMask	( PolyMesh*, VHandle& );

private: // Helper Functions

	void checkImportance	 ( ModelFrame* frame );
	void createMeshes		 ( );						// loads connected/subdivided internal meshes 
	void computeEdgeMidpoints( EHandle& );				// adds edge points to connectivity/subdivided meshes 
	std::vector<int>addFaces ( PolyMesh::FaceIter&);	// adds four new faces in connectivity and subdivided mesh 
	void calculateV_V		 ( VHandle& );				// calculates/sets vertex_vertex subdivided point
	void loadImportance		 ( ModelFrame* frame, FHandle fh, PolyMesh* im );
	void calcConnectivity	 ( const Selection* );
	void doSharpVertex		 ( ModelFrame* f, VHandle& vh );
	void doSharpEdgeSetting	 ( ModelFrame* f, EHandle& eh );
	void loadImportance		 ( ModelFrame* frame, VHandle& vh, PolyMesh* im );
	void calcWeights		 ( const Selection* s );
};

#endif

